package _base0to1;

/**
 * 1232. 缀点成线
 */
public class No1232 {
    public boolean checkStraightLine(int[][] coordinates) {
        int y1 = coordinates[0][1];
        int x1 = coordinates[0][0];
        int y2 = coordinates[1][1];
        int x2 = coordinates[1][0];
        for (int i = 1; i < coordinates.length; i++) {
            int y = coordinates[i][1];
            int x = coordinates[i][0];
            if ((y - y1) * (x - x2) != (y - y2) * (x - x1)) return false;
        }
        return true;
    }
}
